//本地的配置
var config = {
	// base_url: 'http://127.0.0.1:10083/',
	base_url: 'http://localhost:81/boot/',
	//附件访问前缀:  前缀/id
	file_prefix: "/attachment/visit/",
	//前端项目访问前缀  一些js需要额外引入js css 不好写相对目录
	project_prefix: "/lcxm/",
	//是否不缓存js css, 是的话在连接后在时间戳随机数, 不然就加版本号
	noCache: true,
	version: 0
};
// --------------------------------------------------------------------------------------
//服务器的配置
var config2 = {
	// base_url: 'http://127.0.0.1:10083/',
	base_url: 'http://139.129.118.96:81/console/',
	//附件访问前缀:  前缀/id
	file_prefix: "/attachment/visit/",
	//前端项目访问前缀  一些js需要额外引入js css 不好写相对目录
	project_prefix: "",
	//是否不缓存js css, 是的话在连接后在时间戳随机数, 不然就加版本号
	noCache: false,
	version: 4
};
// --------------------------------------------------------------------------------------
var base_url = config.base_url;
var file_prefix = base_url + config.file_prefix;
var project_prefix = config.project_prefix;
var noCache = config.noCache;
var version = config.version;
// --------------------------------------------------------------------------------------

/* 引入通用的js和css */
;
//输出通用css 和js
function writeCommon(cssList, jsList) {
	/**
	 * 组装css标签
	 */
	var cssDocument = cssList.reduce(function(docs, href, index) {
		href = project_prefix + href + addVersion();
		var doc = '<link rel="stylesheet" type="text/css" href="' + href + '" />';
		return docs + doc;
	}, '');
	/**
	 * 组装js标签
	 */
	var jsDocument = jsList.reduce(function(docs, url, index) {
		url = project_prefix + url + addVersion();
		var doc = '<script type="text/javascript" src="' + url + '"></script>';
		return docs + doc;
	}, '');

	document.write(cssDocument + jsDocument);

	function addVersion() {
		if (noCache) {
			return '?v=' + new Date().getTime();
		}
		return '?v=' + version;
	}

}
(function() {
	/* 引入通用的js和css */
	var cssList = [
		'assets/lib/bootstrap3.3.7/css/bootstrap.min.css',
		//jquery-ui-1.12.1
		'assets/lib/jquery-ui-1.12.1/jquery-ui.min.css',
		'assets/lib/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css',
		/* 图标参考  https://materialdesignicons.com/cdn/2.0.46/ */
		'assets/lib/materialdesignicons3.7.95/css/materialdesignicons.min.css',
		/* 多页标签https://gitee.com/edwinhuish/multi-tabs/tree/master/ */
		'assets/lib/bootstrap-multitabs/multitabs.min.css',
		'assets/lib/jquery-treegrid/css/jquery.treegrid.css',
		'assets/lib/bootstrap-table-master/bootstrap-table.min.css',
		'assets/lib/bootstrap3-editable-1.5.1/bootstrap3-editable/css/bootstrap-editable.css',
		'assets/lib/jquery-confirm-v3.3.4/jquery-confirm.min.css',
		/* 字体font-awesome */
		'assets/lib/font-awesome-4.7.0/css/font-awesome.min.css',
		'assets/lib/bootstrap-icon-picker/css/icon-picker.min.css', //icon picker
		'assets/lib/zTree_v3/css/metroStyle/metroStyle.css',
		'assets/lib/select2-develop/dist/css/select2.min.css',
		'assets/lib/bootstrap-select-1.13.9/dist/css/bootstrap-select.min.css',
		'assets/lib/jQuery-File-Upload-10.4.0/css/jquery.fileupload.css',
		//滑块
		'assets/lib/ion.rangeSlider-master/css/ion.rangeSlider.min.css',
		/* 光年的基本样式 */
		'assets/css/style.min.css',
		/* 其他的一些手写的样式 */
		'assets/css/common.css'
	];


	var jsList = [
		'assets/lib/base/jquery.js',
		'assets/lib/base/jquery.form.js',
		'assets/lib/base/vue.min.js',
		'assets/js/jquery-extends.js',
		// 文件上传
		'assets/lib/jQuery-File-Upload-10.4.0/js/vendor/jquery.ui.widget.js',
		'assets/lib/jQuery-File-Upload-10.4.0/js/jquery.iframe-transport.js',
		'assets/lib/jQuery-File-Upload-10.4.0/js/jquery.fileupload.js',
		'assets/lib/jquery-validation-1.19.1/dist/jquery.validate.js',
		'assets/lib/jquery-validation-1.19.1/dist/localization/messages_zh.js',
		'assets/lib/jquery-validation-1.19.1/dist/additional-methods.js',
		'assets/js/jquery-validate-additional.method.js',
		'assets/lib/bootstrap3.3.7/js/bootstrap.min.js',
		//jquery-ui
		'assets/lib/jquery-ui-1.12.1/jquery-ui.min.js',
		'assets/lib/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.min.js',
		'assets/lib/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js',
		'assets/lib/perfect-scrollbar-1.4.0/perfect-scrollbar.min.js',
		'assets/lib/bootstrap-multitabs/multitabs.js',
		'assets/lib/bootstrap-table-master/bootstrap-table.js',
		'assets/lib/jquery-treegrid/js/jquery.treegrid.js',
		'assets/lib/bootstrap-table-master/extensions/treegrid/bootstrap-table-treegrid.js',
		'assets/lib/bootstrap-table-master/locale/bootstrap-table-zh-CN.min.js',
		//行内编辑
		'assets/lib/bootstrap3-editable-1.5.1/bootstrap3-editable/js/bootstrap-editable.js',
		'assets/lib/bootstrap-table-master/extensions/editable/bootstrap-table-editable.js',
		// 图标选择器
		'assets/lib/bootstrap-icon-picker/js/iconPicker.min.js',
		//ztree
		'assets/lib/zTree_v3/js/jquery.ztree.all.min.js',
		'assets/lib/jquery-confirm-v3.3.4/jquery-confirm.js',
		// select2  https://select2.org/
		'assets/lib/select2-develop/dist/js/select2.js',
		'assets/lib/select2-develop/dist/js/i18n/zh-CN.js',
		//bootstrap-select: selectpicker样式将被初始化 参见源码
		'assets/lib/bootstrap-select-1.13.9/dist/js/bootstrap-select.min.js',
		'assets/lib/ion.rangeSlider-master/js/ion.rangeSlider.min.js',
		// 富文本编辑器wangEditor
		'assets/lib/wangEditor-3.1.1/release/wangEditor.min.js',
		'assets/js/common.js',
		'assets/js/request.js'
	];
	writeCommon(cssList, jsList);
})();
